home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
prtfolio
/
new
/
porttpu.txt
< prev
next >
Wrap
Text File
|
1995-04-22
|
14KB
|
449 lines
The Portfolio Unit, version 1.0 (c) 1990 BJ Gleason
by BJ Gleason, The American University
INTRODUCTION
The Portfolio Unit will allow Turbo Pascal programmers
to access many of the features of the Portfolio.
Also included are some of the more important procedures
and function from the CRT unit, which can not be used, since
it expects full hard compatibility.
USING PORTFOLI.TPU
Place the file PORTFOLI.TPU in a directory where Turbo
Pascal can access it.
In your program, include the name PORTFOLIO in the USES
clause in you program.
FUNCTION AND PROCEDURES IN PORTFOLIO.TPU
Replacements functions and procedures for the CRT unit: Will work
on Portfolio or PC
PROCEDURE ClrScr;
Clear the screen.
PROCEDURE GotoXY(X,Y : Integer);
Move cursor to position X, Y.
FUNCTION KeyPressed : Boolean;
Return TRUE if a key has been pressed.
FUNCTION ReadKey : Char;
Wait for a key to be pressed, return the character.
FUNCTION WhereX : Integer;
Return the Horizontal Position of the cursor.
FUNCTION WhereY : Integer;
Return the Vertical position of the cursor.
This function will work on the Portfolio or the PC.
FUNCTION IsPort : Boolean;
This function will return TRUE if running on a
Portfolio, FALSE if not. Handy if you want to run
program on both machines without locking up the PC.
WARNING: There is no positive way to identify the
Portfolio. This functions checks to see if the
Interrupts 60h and 61h vectors are pointing to
0000:0000. These are not normally used on the PC, but
is on the Portfolio. If you are running a TSR that
takes over these vectors, IsPort will return TRUE.
The rest of the procedures and function will only work on the
Portfolio, unless you are using the Portfolio Emulation Software
(I60, I61) on the PC.
PROCEDURE PortAlarm;
This will beep the speaker, about once a second until
the user presses a key. The program will then continue
with the next statement.
PROCEDURE PortBeep;
This will cause a single beep from the speaker.
PROCEDURE PortBox(X1,Y1,X2,Y2,Border : Integer);
This will draw a box. X1 and Y1 specify the upper left
corner position of the box, while X2 and Y2 specify the
lower right corner. Border is 0 for single line box,
and 1 for a double line box.
Trying to draw a box larger than the screen (8x40) has
unpredictable results.
FUNCTION PortBoxAreaCalculation(var X,Y : Integer; Title,
MenuText, DefaultText : String) : Integer;
This function will return the size of the menu in
characters. X and Y are the upper left hand corner.
The function will modify X and Y so they point to the
bottom right corner of the box. Title, MenuText and
DefaultText are the texts you are going to use in the
menu. These function is designed to work with
PortScreenSaveAndRestore to calculate the amount of
memory required to save the screen under the menu.
PROCEDURE PortDial(Number : String);
This will dial the "number" through the speaker. Valid
characters for tones are: 0 1 2 3 4 5 6 7 8 9 A B C D *
#. The letters must be in uppercase.
PROCEDURE PortErrorWindow(X,Y:Integer; Message : String);
This will draw a box around the message and display it
at the specified X,Y. It will then beep and wait for a
keypress. The text underneath the message is left
untouched.
Trying to place the message outside the screen (8x40)
has unpredictable results.
FUNCTION PortGetCursorMode : Integer;
Returns the current cursor mode. You can not detect
mode 3, Force mode. See PortSetCursorMode for details.
FUNCTION PortGetDisplayMode : Integer;
This function will return the current display mode.
See PortSetDisplayMode for details.
FUNCTION PortGetKeyboardLanguage : Integer;
Returns the current keyboard language. See
PortSetKeyboardLanguage for details.
FUNCTION PortGetLogicalScreenCols : Integer;
This function will return the width of the Logical
Screen. Used in conjunction with
PortGetLogicalScreenRows will allow you to determine
the overall size of the Logical screen.
FUNCTION PortGetLogicalScreenRows : Integer;
This function will return the number of rows of the
logical screen.
FUNCTION PortGetPhysicalScreenCols : Integer;
This function will return the width of the Physical
Screen. Used conjunction with
PortGetPhysicalScreenRows will allow you to determine
the overall size of the Physical screen.
FUNCTION PortGetPhysicalScreenRows : Integer;
This function will return the number of rows of the
Physical screen.
FUNCTION PortGetSizeInternalDisk : Integer;
Returns the size of the internal disk in Ks.
FUNCTION PortGetTextLanguage : Integer;
Returns the current text language. See
PortSetTextLanguage for details.
FUNCTION PortGetTickSpeed : Integer;
Returns the Tick speed of the Portfolio. See
PortSetTickSpeed for details.
FUNCTION PortGetVirtualScreenX : Integer;
Returns the current virtual cursor line.
FUNCTION PortGetVirtualScreenY : Integer;
Returns the current virtual cursor column.
PROCEDURE PortInitialization;
Initialize the internal Interrupts. Should be used
before using any of the other routines.
PROCEDURE PortKeyClick;
Make the key click sound.
FUNCTION PortMenu(X, Y, Border, Depth, TopLine, SelectLine :
Integer; Title, MenuText, DefaultText : String) :
Integer;
This will display and allow the user to choose from a
menu. X and Y specify the position of the top left
corner of the screen. Border is 0 for a single line, 1
for a double line. If a single line is selected, the
border and title are only drawn. The Depth variable is
a placeholder, and has no effect in version 1.0.
Topline is the menu entry that should be at the top.
SelectLine is the line the cursor will be set on. The
Title will be display on the Border of the menu. The
each entry in the MenuText has to be separated by an
ASCII 0. DefaultText values for each line will be
displayed on the right hand side of the menu. Each
entry needs to be separated by an ASCII 0. See
TEST.PAS for an example.
PROCEDURE PortMessageWindow(X,Y : Integer; Title, Message :
String);
The text of Message will be displayed in a double line
box. Each line of the Message needs to be separated by
an ASCII 0. The box will be placed at X, Y.
PROCEDURE PortMoveVirtualScreen(Direction, Distance : Integer);
Move the screen in direction for distance number of
character. Works only in Static and Tracked modes.
Same as using the ALT arrow keys. Values for direction
are 1=Up,2=Down,3=Left,4=Right.
PROCEDURE PortOff;
This will turn the Portfolio off until the user presses
a key. The program will then continue execution.
PROCEDURE PortRefresh;
Copy video memory to the LCD controller. Needed for
when you are doing direct write to screen memory.
FUNCTION PortRomVersion : Real;
This function will return the version number of the
Portfolio rom's.